-
Notifications
You must be signed in to change notification settings - Fork 0
Add secret manager #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Add Credential enum (None, SecretRef) for storing credential references - Add ResolvedCredential<'a> borrowed view for runtime credential access - Add with_resolved_credential() closure pattern for scoped plaintext - Update connection_string() to accept ResolvedCredential parameter - Remove plaintext password fields from Source variants
- Update discover_tables() and fetch_table() signatures - Add resolve_connection_string() helper in duckdb and postgres drivers - Update FetchOrchestrator to store and use secret_manager
- Add secret_key field to RivetEngineBuilder - Auto-populate from RIVETDB_SECRET_KEY env var in new() - Allow override via .secret_key() method for tests - Reorder build() to create secret_manager before orchestrator
- Update datafetch tests for new API signatures - Add test secret key generation to TestHarness - Update PostgresFixture to use SecretRef credentials - Store password as secret before Postgres connection tests
RIVETDB_SECRET_KEY is now required at engine startup. Without it, connections with credentials would fail silently at query time.
Split CatalogManager secret methods into metadata (all providers) and encrypted storage (EncryptedSecretManager only). Removes FK constraint between tables. Adds rollback on metadata failure with test coverage.
Extract storage logic into SecretBackend trait, separating metadata coordination from value persistence to enable pluggable backends.
# Conflicts: # src/http/app_server.rs # src/http/handlers.rs # tests/http_server_tests.rs
zfarrell
added a commit
that referenced
this pull request
Jan 6, 2026
* docs: add secret manager design
* feat(secrets): add encryption dependencies
* feat(secrets): add secret name validation
* feat(secrets): add SecretManager trait and types
* feat(secrets): add AES-256-GCM-SIV encryption
* feat(secrets): add secrets tables to v1 migration
* feat(secrets): add EncryptedSecretManager implementation
* feat(secrets): add HTTP request/response models
* feat(secrets): add HTTP handlers for secrets API
* feat(secrets): register secret API routes
* feat(secrets): wire SecretManager into RivetEngine
* feat(source): refactor Source enum for secret references
- Add Credential enum (None, SecretRef) for storing credential references
- Add ResolvedCredential<'a> borrowed view for runtime credential access
- Add with_resolved_credential() closure pattern for scoped plaintext
- Update connection_string() to accept ResolvedCredential parameter
- Remove plaintext password fields from Source variants
* feat(datafetch): add secrets parameter to DataFetcher trait
- Update discover_tables() and fetch_table() signatures
- Add resolve_connection_string() helper in duckdb and postgres drivers
- Update FetchOrchestrator to store and use secret_manager
* feat(engine): add secret_key builder method
- Add secret_key field to RivetEngineBuilder
- Auto-populate from RIVETDB_SECRET_KEY env var in new()
- Allow override via .secret_key() method for tests
- Reorder build() to create secret_manager before orchestrator
* chore: add rand dev-dependency for test key generation
* test: update tests for secret manager integration
- Update datafetch tests for new API signatures
- Add test secret key generation to TestHarness
- Update PostgresFixture to use SecretRef credentials
- Store password as secret before Postgres connection tests
* fix(secrets): make secret manager mandatory with fail-fast
RIVETDB_SECRET_KEY is now required at engine startup. Without it,
connections with credentials would fail silently at query time.
* refactor(secrets): decouple metadata from encrypted storage
Split CatalogManager secret methods into metadata (all providers) and
encrypted storage (EncryptedSecretManager only). Removes FK constraint
between tables. Adds rollback on metadata failure with test coverage.
* refactor(secrets): extract provider type as constant
* refactor(source): move connection string logic to drivers
* refactor(secrets): introduce SecretBackend abstraction
Extract storage logic into SecretBackend trait, separating metadata
coordination from value persistence to enable pluggable backends.
* refactor(secrets): make SecretManager mandatory in APIs
* fix(secrets): surface provider_ref in metadata and backend
* refactor(secrets): split put into distinct create/update flows
* fix(secrets): propagate backend errors on delete
* feat(secrets): implement three-phase delete with status column
* fix(secrets): use db constraint to prevent create race
* fix(secrets): allow delete retry for pending_delete secrets
* fix(http): include validation hint in InvalidName API error
* fix(secrets): add optimistic locking for concurrent creates
* test(secrets): add PUT /secrets/{name} tests and fix flaky test
* prevent log spam; truncate invalid secret names to max characters
* update design doc
* cargo fmt
* clippy fixes
* allow for default security key to simplify onboarding
* remove duplication with error messages
* improve error message
* remove duplicate row struct
* simplify into query builder
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #17.